﻿#ifndef __SS_WORK_THREAD_H__
#define __SS_WORK_THREAD_H__
#include "../../message/ssMsgIdDef.h"
#include "../threadLock/ssThreadCondition.h"
#include "../ssThreadBase.h"
#include "../../container/ssList.h"


namespace StarSeeker
{

class ssThreadPool;

class ssWorkThread : public ssThreadBase
{
	friend class ssThreadPool;
public:
	ssWorkThread(ssThreadPool& pool);
	virtual ~ssWorkThread();

	//当前正在处理的任务数
	ulint GetMsgCount();
protected:
	virtual void ThreadMemberFunc();
	//消息处理
	virtual void HandleMessage(ssMsg_s &m) = 0;
	//线程启动时调用
	virtual void OnThreadRun() { return; }

protected:
	i32					m_threadId;
	i32					m_weight;
	ssThreadPool&		m_pool;
	ssList<ssMsg_s>		m_tempList;		//消息链表
};

}
#endif
